package com.boyinet.imesh2json.bean

import javax.persistence.Entity
import javax.persistence.Id

@Entity
class Template(@Id val id: Long) {

    var name: String = "New Template"
    var sn: String = "sn"
    var signalStrength: String = "signalStrength"
    var powerSource: String = "powerSource"
    var powerSupply: String = "powerSupply"
    var batteryPower: String = "batteryPower"
    var alarmStatus: String = "alarmStatus"
    var originalValue: Boolean = false

    var fields: String = "fields"
    var decimalPlaces: String = "decimalPlaces"
    var unit: String = "unit"
    var sensorType: String = "sensorType"

    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (javaClass != other?.javaClass) return false

        other as Template

        if (id != other.id) return false

        return true
    }

    override fun hashCode(): Int {
        return id.hashCode()
    }

    override fun toString(): String {
        return "Template(id=$id, name='$name', sn='$sn', signalStrength='$signalStrength', powerSource='$powerSource', powerSupply='$powerSupply', batteryPower='$batteryPower', alarmStatus='$alarmStatus', originalValue=$originalValue, unit='$unit', sensorType='$sensorType', fields='$fields')"
    }


}